<?php


  $text = '';
  if (preg_match('/var\s+content\_player\s*\=\s*\[\]\;(.+)window\.content\_player\s*\=\s*content\_player\;/isU', $news_txt, $m_js_all)) {
    preg_match_all('/\'title\'\s*\:\s*\'([^\']+)\'.*\'url\'\s*\:\s*\'([^\']+)\'.*\'imgUrl\'\s*\:\s*\'([^\']+)\'/isU', $m_js_all[1], $m_imgs);
    if (count($m_imgs[3]) > 0) {
      foreach ($m_imgs[3] as $k => $filename) {
        //if ($filename == '' || !preg_match('/^https?:\/\/.+\.(jpg|gif|png)$/i', $filename)) {
        //  die('图片URL输入不合法！网址以http://开头！图片格式限(jpg|gif|png)。');
        //}
        $filename = preg_replace('/\\\/', '', $filename);
        $new_filename = $k.'.'.preg_replace('/.+\.(jpg|gif|png)$/i', '$1', $filename);
        if ($im = read_file($filename)) {
          write_file($extra['img_d'].'/'.$new_filename, $im);
          $img_info = getimagesize($extra['img_d'].'/'.$new_filename);

          if (isset($img_h) && abs($img_h) > 0) {
          } else {
            $img_h = abs($img_info[1] * $extra['w'] / $img_info[0]);
          }

          if (run_img_resize($extra['img_d'].'/'.$new_filename, $extra['img_d'].'/'.$new_filename, 0, 0, $extra['w'], $img_h, $img_info[0], $img_info[1], 80)) {
            $text .= '<a href="'.preg_replace('/\\\/', '', $m_imgs[2][$k]).'" target="_blank" id="e_img_'.$k.'"><img src="inc/'.$extra['img_d'].'/'.$new_filename.'?'.$new_stamp[0].'" /><div class="txt">'.preg_replace('/\\\x22/i', '"', $m_imgs[1][$k]).'</div></a>';
          }
        }
      }
    }
  }
  //echo $text;

?>